package com.ww.seckill.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ww.seckill.entity.Order;
import com.ww.seckill.entity.User;
import com.ww.seckill.vo.GoodsVo;
import com.ww.seckill.vo.OrderDetailVo;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author hexiangdong
 * @since 2022-03-07
 */
public interface IOrderService extends IService<Order> {

    /**
     * 秒杀
     *
     * @param user     用户信息
     * @param goodsVo  商品信息
     * @return
     */
    Order secKill(User user, GoodsVo goodsVo);

    /**
     * 校验验证码
     *
     * @param user
     * @param goodsId
     * @param captcha
     * @return
     */
    Boolean checkCptcha(User user, Long goodsId, String captcha);

    /**
     * 获取秒杀地址
     *
     * @param user
     * @param goodsId
     * @return
     */
    String createPath(User user, Long goodsId);

    /**
     * 校验秒杀地址
     *
     * @param user
     * @param path
     * @param goodsId
     * @return
     */
    Boolean checkPath(User user, String path, Long goodsId);

    /**
     * 获取订单信息
     *
     * @param orderId
     * @return
     */
    OrderDetailVo getDetail(Long orderId);

}
